<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml"
      xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <title>服务设备</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=e9c5bb62">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=66b457d6">
    <style>
        table input {
            border: none;
            width: 100%;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        input[type=text], input[type=tel], input[type=number], select {
            box-sizing: border-box;
            border-width: 0px;
            border-style: none;
            padding-right: 0px !important;
            padding-top: 0px !important;
            padding-bottom: 0px !important;
            margin-left: 0px !important;
            margin-right: 0px !important;
            margin-top: 0px !important;
            margin-bottom: 0px !important;
            padding-left: 6px;
        }

        input[type=text], input[type=tel], input[type=number], select {
            height: 24px;
            width: 100%;
            border: none;
            outline: none;
            overflow: hidden;
            text-overflow: ellipsis;
        }
    </style>
</head>

<body>
<section class="content" id="app" v-cloak=>
    <div id="div" style="margin-top: 12px">
        <div class="box-body no-padding iframeH2" style="overflow: auto;margin-top:-20px"
             id="scrollDiv">
            <div id="progress" class="wyui-progress"></div>
            <table class="table table-bordered text-center" id="week">
                <th colspan="4" style="min-width: 300px;height: 30px;background-color:yellow;" class="tableTitle"><span
                        style="text-align:center;height:18px;color:black;" class="tableTitle">品牌公司管理</span></th>
                <tr class="td-row2 td-value" style="height:30px;">
                    <td style="width: 25%;color:black;background-color:#F8F8F8">品牌</td>
                    <td class="td-value1">
                        <select id="testBran" v-model="brandId" @change="getByBrandId()">
                            <option v-for="items in brandList" v-bind:value="items.id">{{items.name}}</option>
                        </select>
                    </td>
                    <td style="width: 25%;color:black;background-color:#F8F8F8">品牌公司</td>
                    <td><input type="text" id="authenticbrandsGroup" v-model="brand.authenticbrandsGroup"></td>
                </tr>
                <tr class="td-row2 td-value" style="height:30px">
                    <td style="width: 25%;color:black;background-color:#F8F8F8">质保公司</td>
                    <td>
                        <input type="text" id="qualityCompany" v-model="brand.qualityCompany">
                    </td>
                    <td style="width: 25%;color:black;background-color:#F8F8F8">融资公司</td>
                    <td style="width: 25%;"><input type="text" id="financeCompany" v-model="brand.financeCompany">
                    </td>
                </tr>
                <tr class="td-row2 td-value" style="height:30px">
                    <td style="width: 190px;color:black;background-color:#F8F8F8">制造公司</td>
                    <td colspan="3">
                        <input type="text" id="manufacturingCompany" v-model="brand.manufacturingCompany">
                    </td>
                </tr>
            </table>
            <div class="south no-print" style="height:50px;line-height:50px;text-align:center;">
                <input type="button" id="save" class="btn btn-primary btn-sm" @click="save()" value="保存">
                <input type="button" value="取消" class="btn  btn-primary btn-sm" id="getBy" @click=close()>
            </div>
        </div>
    </div>
</section>

</body>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=0b5caf39"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=0c4d95a9"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript">
    var api = frameElement.api, W = api.opener;
    var app = new Vue({
        el: '#app',
        data: {
            brandId: '',
            brandList: [],
            brand: {
                id: '',
                brandName: '',
                qualityCompany: '',
                authenticbrandsGroup: '',
                financeCompany: '',
                manufacturingCompany: '',
            },
        },
        methods: {
            save: function (id) {
                var that = this;
                if(that.brand.id!=''){
                    $.wyui.postMethod('/deviceBrand/update.json', trimRN(that.brand), function (r) {
                        alert("保存成功");
                        api.close();
                    });
                }else{
                    alert("品牌为必填项");
                }
            },
            close: function () {
                api.close();
            },
            showDatePicker: function (e, index) {
                var that = this;
                console.log(index)
                WdatePicker({
                    onpicked: function (dp) {
                        that.customer.years = dp.cal.getNewDateStr();
                        return true;
                    }
                });
                $(e.target).blur();
            },
            getByBrandId: function () {
                var that = this;
                $.wyui.postMethod('/deviceBrand/getBrandById.json', {id: that.brandId}, function (r) {
                    that.brand = r
                })
            },
        },
        mounted: function () {
            var that = this;
            $.wyui.postMethod("/deviceBrand/getBrandList2.json", {}, function (r) {
                that.brandList = r.brands;
            });
        }
    })
</script>

</html>